/*
Copyright [2020] [https://www.stylefeng.cn]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Guns采用APACHE LICENSE 2.0开源协议，您在使用过程中，需要注意以下几点：

1.请不要删除和修改根目录下的LICENSE文件。
2.请不要删除和修改Guns源码头部的版权声明。
3.请保留源码和相关描述文件的项目出处，作者声明等。
4.分发源码时候，请注明软件出处 https://gitee.com/stylefeng/guns-separation
5.在修改包名，模块名称，项目代码等时，请注明软件出处 https://gitee.com/stylefeng/guns-separation
6.若您的项目无法满足以上几点，可申请商业授权，获取Guns商业授权许可，请在官网购买授权，地址为 https://www.stylefeng.cn
 */
package cn.stylefeng.guns.core.consts;

/**
 * 通用常量
 *
 * @author xuyuxiang
 * @date 2020/3/11 16:51
 */
public interface CommonConstant {

    /**
     * id
     */
    String ID = "id";

    /**
     * 名称
     */
    String NAME = "name";

    /**
     * 编码
     */
    String CODE = "code";

    /**
     * 值
     */
    String VALUE = "value";

    /**
     * 默认标识状态的字段名称
     */
    String STATUS = "status";

    /**
     * 默认逻辑删除的状态值
     */
    String DEFAULT_LOGIC_DELETE_VALUE = "2";

    /**
     * 用户代理
     */
    String USER_AGENT = "User-Agent";

    /**
     * 请求头token表示
     */
    String AUTHORIZATION = "Authorization";

    /**
     * token类型
     */
    String TOKEN_TYPE_BEARER = "Bearer";

    /**
     * 首页提示语
     */
    String INDEX_TIPS = "Welcome To New Guns";

    /**
     * 未知标识
     */
    String UNKNOWN = "Unknown";

    /**
     * 默认包名
     */
    String DEFAULT_PACKAGE_NAME = "cn.stylefeng";

    /**
     * 默认密码
     */
    String DEFAULT_PASSWORD = "LcKjY_1#2?3";

    /**
     * 请求号在header中的唯一标识
     */
    String REQUEST_NO_HEADER_NAME = "Request-No";

    /**
     * 图形验证码key
     */
    String CAPTCHA_CODE = "CAPTCHA_CODE";

    /**
     * 注册验证码key
     */
    String REGISTER_CODE = "REGISTER_CODE";

    /**
     * 修改密码验证码key
     */
    String MODIFY_PASSWORD_CODE = "MODIFY_PASSWORD_CODE";

    /**
     * 注册验证码过期时间
     */
    long REGISTER_CODE_EXP_TIME = 5 * 60L;

    /**
     * 图形验证码key过期时间10分钟
     */
    long CAPTCHA_CODE_EXP_TIME = 10*60L;

    /**
     * 用户锁定rediskey前缀
     */
    String USER_LOCK_PREFIX = "USER_LOCK:";

    /**
     * 客服对接，本地存储的用户
     */
    String USER_SOURCE_TYPE_LOCALE = "01";
    /**
     * 客服对接，远程表的用户
     */
    String USER_SOURCE_TYPE_REMOTE = "02";
    /**
     * 客服对接，登陆失败次数
     */
    String USER_LOGIN_FAIL_COUNT = "USER_LOGIN_FAIL_COUNT:";
    /**
     * 客服对接，登陆失败次数
     */
    String USER_LOGIN_FIRST_FAIL_TIME = "USER_LOGIN_FIRST_FAIL_TIME:";
    /**
     * 客服对接，修改密码失败次数
     */
    String USER_UPD_PWD_FIRST_FAIL_TIME = "USER_UPD_PWD_FIRST_FAIL_TIME:";
    /**
     * 账户锁定状态
     */
    String USER_LOCK_STATUS = "USER_LOCK_STATUS:";

    /**
     * 用户验证密码rediskey前缀
     */
    String USER_CHECK_PWD_PREFIX = "USER_CHECK_PWD:";

    /**
     * 用户锁定时间,单位为秒
     */
    long USER_LOCKED_TIME = 5 * 60L;

    /**
     * 用户锁定时间,单位为秒
     */
    long USER_LOCKED_TIME_MIN = USER_LOCKED_TIME / 60L;

    /**
     * 登录失败次数时间范围, 20分钟内登录失败
     */
    long LOGIN_FAILED_CYCLE = 20 * 60L;

    /**
     * 连续登陆失败次数锁定
     */
    int MAX_LOGIN_FAILED_LOCK_COUNT = 5;

    /**
     * 上次修改密码时间范围, 180以上提示修改密码
     */
    long LAST_UPD_PWD_SCOPE = 180L;

    String ACCOUNT_PWD_EMPTY = "account_pwd_empty";

    String ACCOUNT_PWD_ERROR = "account_pwd_error";

    String VALID_CODE_ERROR = "valid_code_error";

    String REQUEST_TOKEN_EMPTY = "request_token_empty";

    String NOT_VALID_TOKEN_TYPE = "not_valid_token_type";

    String REQUEST_TOKEN_ERROR = "request_token_error";

    String ACCOUNT_FREEZE_ERROR = "account_freeze_error";

    String LOGIN_EXPIRED = "login_expired";

    String NO_LOGIN_USER = "no_login_user";

    String USER_LOCKED = "user_locked";

    String CAPTCHA_NULL = "captcha_null";

    String CAPTCHA_EXP_TIME = "captcha_exp_time";

    String CAPTCHA_VALIDATE_ERROR = "captcha_validate_error";

    String DECRYPT_ERROR = "decrypt_error";

    String ACCOUNT_CERT_INCONSISTENT = "account_cert_inconsistent";

    String ACCOUNT_CERT_FAIL = "account_cert_fail";

    String INVALID_REUQEST = "invalid_reuqest";
}
